package com.meilai.project.controller.web.market.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.meilai.project.controller.web.market.entity.BillMarketPlan;
import com.meilai.project.controller.web.market.mapper.BillMarketPlanMapper;
import com.meilai.project.controller.web.market.service.BillMarketPlanService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BillMarketPlanServiceImpl extends ServiceImpl<BillMarketPlanMapper, BillMarketPlan> implements BillMarketPlanService {
    @Override
    public void deleteByMarketId(Long marketId) {
        LambdaQueryWrapper<BillMarketPlan> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(BillMarketPlan::getBill_market_id, marketId);
        remove(wrapper);
    }

    @Override
    public List<BillMarketPlan> listByMarketId(Long marketId) {
        LambdaQueryWrapper<BillMarketPlan> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(BillMarketPlan::getBill_market_id, marketId);
        return list(wrapper);
    }
}
